package Internet_Proxy_13;

public class ProxyInternet implements Internet {
    private RealInternet realInternet = new RealInternet();

    @Override
    public void connectTo(String url) {
        if(url.contains("banned.com")) {
            System.out.println("访问被禁止: " + url);
            return;
        }//模拟黑名单

        System.out.println("代理正在连接到: " + url);
        realInternet.connectTo(url);
        System.out.println("代理连接完成: " + url);
    }
}
